<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定时器案例</title>
    <style>
        textarea{
            width: 300px;
            height: 90px;
        }
        button{
            width: 120px;
            height: 25px;
        }
    </style>
</head>
<body>
    <textarea name="" id="">我想摸你的头发 只是简单的试探啊 我想给你一个拥抱 像以前一样可以吗</textarea><br>
    <button disabled>阅读用户协议(5)</button>
    <script>
        const btn = document.querySelector('button')
        let i = 5
        let n = setInterval(() => {
            btn.innerHTML = `阅读用户协议(${--i})`
            if (i === 0){
                clearInterval(n)
                btn.disabled = false
            }
        }, 1000);
    </script>
</body>
</html>